<?php $this->load->view('layout/header'); ?>

<script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
        theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
</script>
<script type="text/javascript">
    //<![CDATA[
    function WebForm_OnSubmit() {
        if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
        return true;
    }
    //]]>
</script>
<form name="form1" method="post" action="<?php echo b_url('wechat/config_action/')?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
    <div>
    </div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">微信App配置</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * AppId：
                </td>
                <td>
                    <input name="appid" type="text" id="appid" value="<?php echo $info['appid']?>" />
                    <span id="appid_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * AppSecret：
                </td>
                <td>
                    <input name="appsecret" type="text" id="appsecret" value="<?php echo $info['appsecret']?>" />
                    <span id="appsecret_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * Token：
                </td>
                <td>
                    <input name="token" type="text" id="token" value="<?php echo $info['token']?>" />
                    <span id="token_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    * 开发者验证：
                </td>
                <td>
                    <span id="radIsClose">
                        <input id="radIsClose_0" type="radio" name="ischeck" value="1" <?php if($info['ischeck'] == 1){echo 'checked="checked"';}?> /><label for="radIsClose_0">是</label>
                        <input id="radIsClose_1" type="radio" name="ischeck" value="0" <?php if($info['ischeck'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                    <span id="RequiredFieldValidator9" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit" value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button" value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
        $('#form1').submit(function() {
            var is = true;
            if (!input_tips($('#appsecret'))) {
                is = false;
            }
            if (!input_tips($('#token'))) {
                is = false;
            }
            if (!selete_tips($('#appid'))) {
                is = false;
            }
            return is;
        });
    </script>
    </body>
    </html>